Contents

import plotly.graph_objects as go


# Define data for the climate system components with approximate locations
components = [
    {"name": "Atmosphere", "lat": 30, "lon": -120, "desc": "The air layer surrounding Earth, driving weather and climate."},
    {"name": "Hydrosphere", "lat": -20, "lon": 160, "desc": "All water on Earth, including oceans, rivers, and lakes."},
    {"name": "Cryosphere", "lat": 80, "lon": 0, "desc": "Frozen parts of Earth, like ice caps, glaciers, and snow cover."},
    {"name": "Lithosphere", "lat": 0, "lon": 30, "desc": "Earth's crust and upper mantle, storing carbon and influencing climate."},
    {"name": "Biosphere", "lat": 10, "lon": -70, "desc": "All living organisms that impact and are impacted by climate."}
]

# Create the map with plotly
fig = go.Figure(go.Scattergeo(
    lon=[comp["lon"] for comp in components],
    lat=[comp["lat"] for comp in components],
    text=[f"{comp['name']}: {comp['desc']}" for comp in components],
    mode="markers+text",
    marker=dict(size=10, color="blue", symbol="circle"),
    textposition="top center"
))

# Set layout for the map
fig.update_layout(
    title="Earth's Climate System Components",
    geo=dict(
        showland=True,
        landcolor="rgb(243, 243, 243)",
        oceancolor="rgb(204, 224, 255)",
        showocean=True,
        projection_type="orthographic",
        lonaxis=dict(showgrid=True),
        lataxis=dict(showgrid=True)
    )
)

fig.show()